package com.example.demo.swj.uitl;


/**
 * @author lizhongcheng
 * @date 2020/8/26 17:07
 **/
public class NeuqApiException extends RuntimeException {

    private NeuqResponse neuqResponse;

    private String errCode;
    private String errMsg;

    public NeuqApiException() {
        super();
    }

    public NeuqApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public NeuqApiException(String message) {
        super(message);
    }

    public NeuqApiException(Throwable cause) {
        super(cause);
    }

    public NeuqApiException(String errCode, String errMsg) {
        super(errCode + ":" + errMsg);
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public NeuqApiException(String errCode, String errMsg, NeuqResponse neuqResponse) {
        this(errCode, errMsg + "->[code:" + neuqResponse.getCode() + "|message:" + neuqResponse.getMessage() + "|subCode:" + neuqResponse.getSubCode() + "|subMessage:" + neuqResponse.getSubMessage() + "]");
        this.neuqResponse = neuqResponse;
    }

    public String getErrCode() {
        return this.errCode;
    }

    public String getErrMsg() {
        return this.errMsg;
    }

    public NeuqResponse getNeuqResponse() {
        return this.neuqResponse;
    }
}
